package com.woniuxy.intellihome.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.intellihome.entity.VCollect;
import com.woniuxy.intellihome.entity.VReview;
import com.woniuxy.intellihome.mapper.VCollectMapper;
import com.woniuxy.intellihome.mapper.VReviewMapper;
import com.woniuxy.intellihome.service.VCollectService;
import com.woniuxy.intellihome.service.VReviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jobob
 * @since 2021-08-11
 */
@Service
public class VReviewServiceImpl extends ServiceImpl<VReviewMapper, VReview> implements VReviewService {
    @Autowired
    private VReviewMapper vReviewMapper;

    @Override
    public List<VReview> getAllReviewByUserId(int userId) {
        return vReviewMapper.getAllReviewByUserId(userId);
    }

    @Override
    public List<VReview> getAllReviewBySpuId(int spuId) {
        return vReviewMapper.getAllReviewBySpuId(spuId);
    }

    @Override
    public List<VReview> getAllReviewBySpuIdAndType(int spuId, String type) {
        return vReviewMapper.getAllReviewBySpuIdAndType(spuId,type);
    }
}
